import { request, decodeURI } from '../utils'

export async function query (params) {
  console.log("params==",params)
  if(params.keyword){
      const url = '/customerManage/queryCustomer?jsessionid=' + localStorage.getItem("token") + '&length=' + params.pageSize + '&offset=' + (params.current-1) + 
      "&customerType=9" +"&autStatus="+params.autStatus;
      return request(url, {
        method: 'get',
        data: params
      })
  }else{
      const url = '/customerManage/queryCustomer?jsessionid=' + localStorage.getItem("token") + '&length=' + params.pageSize + 
      '&offset=' + (params.current-1)+"&customerType=9" +"&autStatus="+params.autStatus;
      return request(url, {
        method: 'get',
        data: params
      })
  }
}
export async function Audits(params){
  const url = '/verify/CustomerAut?jsessionid=' + localStorage.getItem("token")+'&id=' +params.id +'&payType='+params.payType+'&payWay='+params.payWay+
  '&status='+params.status +'&unitPrice='+params.unitPrice
  return request(url, {
    method: 'get',
    data: JSON.stringify(params)
  })
}
export async function driverAudit (params) {
  const url = '/verify/driverAut?customerId='+ params.id +'&aut=' + params.aut +'&jsessionid=' + localStorage.getItem("token")
  return request(url, {
    method: 'post',
    headers: {'Accept': 'application/json','Content-Type': 'application/json'},
    body: JSON.stringify(params.roleEntry)
  })
}
export async function MFTAut (params) {
  const url = '/verify/manufactureAut?customerId='+ params.id +'&aut=' + params.aut +'&jsessionid=' + localStorage.getItem("token")
  return request(url, {
    method: 'post',
    headers: {'Accept': 'application/json','Content-Type': 'application/json'},
    body: JSON.stringify(params.roleEntry)
  })
}
export async function serial(params){
  console.log("111==",params)
  const url = '/customerManage/get/'+params+'?jsessionid=' + localStorage.getItem("token")
  return request(url, {
    method: 'get',
    data: params
  })
}





